package com.google.code.vimsztool;

import java.lang.reflect.Method;

import junit.framework.TestCase;

import com.google.code.vimsztool.compiler.CompilerContext;

public class CompilerContextTest extends TestCase {

	public void testBuildClassName() {
		CompilerContext cc=new CompilerContext("test/classPath.xml");
		assertEquals("org.wsn.Orange", 
				cc.buildClassName("/project/code-incomplete/java/jdt/test/src/org/wsn/Orange.java"));
	}


	public void testGetClassLoader() {
		
		CompilerContext cc=new CompilerContext("test/classPath.xml");
		try {
			Class c=cc.getClassLoader().loadClass("java.lang.String");
			Method[]  methods=c.getMethods();
			for (Method method : methods) {
				System.out.println(method.getName());
			}
			Package[] packages=cc.getClassLoader().getPackageInfo();
			for (Package pi : packages) {
				System.out.println(pi.getName());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
